<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.father {
			width: 300px;
			border: 1px solid red;
			/*overflow: hidden; */    /*给父盒子添加overflow、float、定位、display等属性激活BFC即可清除浮动*/
			/*float: left;*/
			/*position: absolute;*/
			display: inline-block;
		}
		.son1,.son2 {
			width: 100px;
			height: 100px;
			background-color: pink;
			float: left;
		}
		.son2 {
			background-color: purple;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son1"></div>
		<div class="son2"></div>
	</div>
</body>
</html>